﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            double[] f =new double [5];

            Main01(f);
        }




        //四位数作业
        static void Mai()
        {


          

            Console.WriteLine("请输入一个四位数整数：");
            String a = Console.ReadLine();
            int b = int.Parse(a);

            Console.WriteLine("千位:" + b / 1000 + "  百位：" + b % 1000 / 100 + "  十位：" + b % 1000 % 100 / 10 + "  个位：" + b % 1000 % 100 % 10);

        }



        //最大值作业
        static void Ma()
        {

        
            int[] d = new int[3];


            for (int i = 0; i < d.Length; i++)
            {

                Console.WriteLine("请输入第" + (i + 1) + "位数");
                String c = Console.ReadLine();
                d[i] = int.Parse(c);

            }
            int e = d[0];
            for (int i = 0; i < d.Length; i++)
            {

                if (e < d[i])
                {
                    e = d[i];
                }

            }
            Console.WriteLine("最大值为：" + e);
        }

//字符串输出作业
        static void Main00()
        {
            Console.WriteLine("请输入一行字符串：");
            String a = Console.ReadLine();

            int b = 0;
            int c = 0;
            int d = 0;

            foreach (var item in a)
            {
                if (char.IsDigit(item))
                {
                    b++;
                }
                else if(char.IsLetter(item))
                {
                    c++;
                }
                else if (char.IsWhiteSpace(item))
                {
                    d++;

                }

             



            }

            Console.WriteLine("该字符串中有{0}个数字、{1}个字母、{2}个空格",b,c,d);
        }







            //平均值和最大值作业
            static void Main0(double [] f)
        {
            double num = f[0];
            double Avg = 0;


            for (int i = 0; i < f.Length; i++)
            {
                Console.WriteLine("请输入第{0}个学生的成绩：",i+1);
                String a = Console.ReadLine();
                f[i] = double.Parse(a);


            

            }

            
            foreach (var item in f)
            {
                num += item;
                Avg = num / f.Length;

            }

            Console.WriteLine("总值为：{0}、平均值为：{1}:",num,Avg);

        }

        static void Main01(double[] f)
        {
            double[] a = new double { 8, 9, 47, 4, 6 };

            Array.Sort(a);
            Array.Reverse(a);

            foreach (var item in a)
            {
                Console.WriteLine(item+",");
            }



        }



        }
}